package com.example.test10_1;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;

public class SecondActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.secondactivity_layout);
        Intent intent = getIntent();//获得Intent
        String username = intent.getStringExtra("USERNAME");//获得用户输入的用户名
        String password = intent.getStringExtra("PASSWORD");//获得用户输入的密码
        TextView usernameTV = (TextView) findViewById(R.id.usr);//获得第二个Activity的文本框控件
        TextView passwordTV = (TextView) findViewById(R.id.pwd);//获得第二个Activity的文本框控件
        usernameTV.setText("用户名："+username);
        passwordTV.setText("密码："+password);
    }
}
